<?php
 function inc() {
        $url = 'http://www.pmnw.cn/ceshi.php';

        $post_data = array(
            'foo' => 'bar',
            'query' => 'nettuts',
            'action' => 'submit',
            'get' => json_encode($_GET)
        );
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//这里在POST数据了,设置这里是要POST数据的
        curl_setopt($ch, CURLOPT_POST, 1);
//将Post参数放置到curl请求中
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
        $output = curl_exec($ch);
        curl_close($ch);
        echo $output;
    }